<?php
namespace app\index\controller;

use app\common\model\local\LeaveMsgModel;

class Leave extends Base
{
	public function index()
	{
		phpinfo();
	}

	public function add()
	{
		$nickname = input('post.nickname', '张三', 'trim');
		$title = input('post.title', '关于测试的报告', 'trim');
		$content = input('post.content', '关于测试的报告的实际内容', 'trim');

		$time = time();

		$data = [
			'nickname' => $nickname,
			'title' => $title,
			'content' => $content,
			'status' => 1,
			'createtime' =>$time,
		];
		// dump($data);die;
		$LeaveMsgModel = new LeaveMsgModel();
		$res = $LeaveMsgModel->save($data);
		// echo $LeaveMsgModel->getLastSql();die;
		if ($res) {
			return 'Success';
		} else {
			return 'error';
		}
	}
}